1   /************************************************************
2   *                     Copyright                            *
3   * Portions of this software are Copyright (c) 1993 - 2002, *
4   * Chad Z. Hower (Kudzu) and the Indy Pit Crew              *
5   *  - http://www.nevrona.com/Indy/                          *
6   ************************************************************/
7   package org.indy;
8   
9   /***
10   *
11   * A listener interface for receiving notification of status changes and read / write operations
12   * in an {@link IndyComponent}.
13   *
14   * Classes implementing this interface can register their interest in a given <code>IndyComponent</code>
15   * instance using the {@link IndyComnponent@addComponentListener(IndyComponentListener)} interface.
16   *
17   *@author    Owen Green
18   *@version   1.0
19   *@see IndyComponent
20   *@see IndyComponent#addComponentListener(IndyComponentListener)
21   */
22  public interface IndyComponentListener {
23    /***
24     *  Signals a state change in the {@link IndyComponent} passed in the <code>sender</code>
25     *  parameter. The new state is an instance of {@link Status}, and a string representation
26     *  of this information is also provided which can be fed back to the user.
27     *
28     *@param  sender      The <code>IndyComponent</code> whose state has changed.
29     *@param  status      The new <code>Status</code> of the component.
30     *@param  statusText  A friendly string represention of the state change.
31     *@see IndyComponent
32     *@see Status
33     */
34    public void onStatus(IndyComponent sender, Status status, String statusText);
35  
36    /***
37     *  Signals that the {@link IndyComponent} passed in <code>sender</code> has
38     *  commenced a chunk of work of the given {@link IndyComponent.WorkMode} that will entail
39     *  processing <code>size</code> bytes. If <code>size=0</code> then it can be ignored.
40     *
41     *@param  sender        The <code>IndyComponent</code> starting a chunk of work.
42     *@param  workMode      The <code>WorkMode</code> of this work
43     *@param  workCountMax  The size of the job.
44     *@see IndyComponent
45     *@see IndyComponent.WorkMode
46     */
47    public void onBeginWork(IndyComponent sender, IndyComponent.WorkMode workMode, 
48                            int size);
49  
50    /***
51     *  Signals that a piece of work of a given {@link IndyComponent.WorkMode} undertaken by
52     *  the {@link IndyComponent} <code>sender</code> has progressed by <code>workCount</code>
53     *  bytes.
54     *
55     *@param  sender     The <code>IndyComponent</code> that is working
56     *@param  workMode   The <code>WorkMode</code> of the work underway.
57     *@param  workCount  The progress made.
58     *@see IndyComponent
59     *@see IndyComponent.WorkMode
60     */
61    public void onWork(IndyComponent sender, IndyComponent.WorkMode workMode, 
62                       int workCount);
63  
64    /***
65     *  Signals that a chunk of work of the given {@link IndyComponent.WorkMode} has been
66     *  compoleted by the {@link IndyComponent} <code>sender</code>
67     *
68     *@param  sender    The <code>IndyComponent</code> that has completed work
69     *@param  workMode  The <code>WorkMode</code> of the completed work.
70     *@see IndyComponent
71     *@see IndyComponent.WorkMode
72     */
73    public void onEndWork(IndyComponent sender, IndyComponent.WorkMode workMode);
74  }
This page was automatically generated by Maven